#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <unordered_map>

using namespace std;

class Solution {
public:
    int minSubArrayLen(int target, vector<int>& nums) {
        int n = nums.size();
        int len = INT_MAX;
        int left = 0, right = 0;
        int sum = 0;
        while (right < n)
        {
            sum += nums[right];
            while (sum >= target)
            {
                len = min(len, right - left + 1);
                sum -= nums[left++];
            }
            right++;
        }

        return len == INT_MAX ? 0 : len;
    }
};

int main()
{
	
	return 0;
}